package com.xiaoran.spring.service.Impl;

import com.xiaoran.spring.dao.AccountDao;
import com.xiaoran.spring.service.AccountService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

@Service
@Slf4j
public class AccountServiceImpl implements AccountService {
    @Resource
    private AccountDao accountDao;

    public void delete(Long user_id, BigDecimal money) {
        log.info("------->account-service中扣减账户余额开始");
        try{ TimeUnit.SECONDS.sleep(20); } catch (InterruptedException e) { e.printStackTrace(); }
        accountDao.delete(user_id,money);
        log.info("------->account-service中扣减账户余额结束");

    }
}
